<%@ page language="java" import="up7.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@	page import="com.google.gson.Gson" %>
<%@ page import="up7.model.*" %>
<%@ page import="up7.biz.*" %>
<%@ page import="up7.utils.*" %>
<%@ page import="up7.database.sql.SqlFile" %>
<%@	page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="java.net.URLDecoder" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="net.sf.json.JSONObject" %>
<%@ page import="up7.sql.SqlWhereMerge" %>
<%@ page import="up7.sql.SqlExec" %>
<%@ page import="net.sf.json.JSONArray" %>
<%@ page import="filemgr.PageFileMgr" %>
<%
    out.clear();

    WebBase web = new WebBase(pageContext);

    String uid 		= web.reqStr("uid");
    String id		= web.reqStr("id");
    String callback = web.reqStr("callback");//jsonp
    int cover		= web.reqInt("cover");//是否覆盖

    //返回值。1表示成功
    int ret = 0;
    if ( !StringUtils.isBlank(id))
    {
    	SqlFile db = SqlFile.build();
    	db.complete(id);
    	FileInf file = db.read(id);

        //覆盖同名文件-更新同名文件状态
        if(cover == 1) db.delete(file.pathRel, uid, id);
    	ret = 1;
      	
        up7_biz_event.file_post_complete(id);
    }
    out.write(callback + "(" + ret + ")");
%>